package com.ys.chatserver.rtc;

import com.alibaba.fastjson.JSONObject;

public class RtcCommonAck {
    public RtcCommonAck(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {

        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    protected int code;
    protected String msg;

    public String toString() {
        return "code:" + code + ",msg:" + msg;
    }

    /**
     * 成功
     */
    public static String authSuccess() {
        RtcCommonAck acck = new RtcCommonAck(0, "auth success");
        return JSONObject.toJSONString(acck);
    }

    /**
     * 失败
     */
    public static String authFailure() {
        RtcCommonAck acck = new RtcCommonAck(1, "auth failure");
        return JSONObject.toJSONString(acck);
    }
}
